package com.kaifamiao.www.ioDemo.do0923;

import java.lang.reflect.Method;

public class getMethodsDemo1 {
    public static void main(String[] args) throws NoSuchMethodException {
        /**getMethod
         * 获取方法，返回一个方法对象
         *
         */

        Class<Student> cl = Student.class;
        Method method = cl.getMethod("getName");
        System.out.println(method);

        Method[] method1 = cl.getMethods();
        for (Method mt:method1){
            System.out.println(mt);
        }
    }
}
